<template>
  <div style=" padding: 15px;">
    <div>
      <div style="margin-top: 15px;margin-bottom: 15px;display: flex;justify-content: center">
        <div  style="flex: 1">
          <el-input placeholder="请输入车牌号" v-model="s" class="input-with-select" style="width: 200px"> </el-input>
          <el-button type="primary" icon="el-icon-search" >查询</el-button>
        </div>
        <div>
          <el-button type="primary" icon="el-icon-plus" @click="$router.push({ path: '/information/driverEdit'})" >添加</el-button>
        </div>
      </div>
    </div>
    <UTable ref="mTable" :search-api="getDriverPageList" :columns="columns" />

  </div>

</template>
<script>
  import UTable from '@/components/UTable'
  import {edit,getDriverPageList} from '@/api/driver'
  export default {
    components: {
      UTable
    },
    data() {
      return {

        getDriverPageList:getDriverPageList,
        columns: [
          { type: 'index', width: 60 },
          { type: 'selection', width: 60 },
          // { type:'avatar',prop: 'headImage', label: '头像',width:100 },
          { prop: 'name', label: '司机姓名',width:'100px' },
          { prop: 'carid', label: '车辆编号',width:100 },
          { prop: 'age', label: '车型',width:'100px' },
          { prop: 'phone', label: '联系电话',width:'150px' },
          { prop: 'idcardNumber', label: '身份证号码',width:150},
          { prop:'driverLicense',label:'驾驶许可证',width:150},
          { prop: 'achievement', label: '业绩/单',width:150 },
          { prop: 'refund', label: '退单数量',width:150 },
          { prop: 'status', label: '状态',width:'100px', filters:[{ text: '启用', value: '1' },{ text: '禁用', value: '0' }] },
          { prop: 'workstatus', label: '工作状态',width:'100px', filters:[{ text: '开工', value: '1' },{ text: '忙绿', value: '0' },{ text: '收工', value: '2' }] },
          { prop: 'worktimeBegin', label: '工作时间',width:'100px' },

          { type: 'handle', fixed: 'right', buttons: [
              { text: '编辑', type: 'ifno' },
              { text: '定位', type: 'ifno' },
              { text: '启用', type: 'danger', isShow: function(row, rowIndex) { return row.status === 0 } },
              { text: '禁用', type: 'danger', isShow: function(row, rowIndex) { return row.status === 0 } }
            ]
          }
        ]
      }
    }
  }
</script>

<style scoped>

</style>
